package com.wd.mylibrary_square.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wd.mylibrary_base.bean.WatchBean
import com.wd.mylibrary_base.utils.HttpUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 * 作者: 邢凌志
 * 时间: 2024/9/18
 * 描述: WatchViewModel
 */
class WatchViewModel : ViewModel() {
    var watchData=MutableLiveData<WatchBean>()

    fun getWatchData(userId:Int,sessionId:String,liveId:Int){
        viewModelScope.launch(Dispatchers.IO) {
            watchData.postValue(HttpUtils.httpUtils.apiService.getWatch(userId,sessionId,liveId))
        }
    }
}